<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Console extends CI_controller {

	public function __construct(){
		parent::__construct();
	}

	public function index(){
        // die();
		$data = array();
		if($this->session->userdata('user') !== false) {
			$data['user'] = json_encode($this->session->userdata('user'));
		}
		$this->load->view('zm/console',$data);
	}

    private function _ShowType4Html($arr){
        $result = array();
        foreach ($arr as $k => $v) {
            $result[] = $k.'=>'.$v;
        }
        return $result;
    }

	public function getApis() {
        // die();
        global $g_bluemember_gift,$g_marathon_gift;
		$apis = array(
			array(
                'url' => 'api_hb_bjmarathon/getCaptcha',
                'title' => 'bjmarathon-获取短信验证码',
                'group_name' => 'bjmarathon',
                'params' => array(
					array('name' => 'bluemember_phone','value' => '18618419289'),
                ),
                'remark' => '',
            ),
			array(
                'url' => 'api_hb_bjmarathon/initCustomer',
                'title' => 'bjmarathon-初始化用户',
                'group_name' => 'bjmarathon',
                'params' => array(
					array('name' => 'bluemember_phone','value' => '18618419289'),
                    array('name' => 'captcha','value' => '666666'),
					array('name' => 'source', 'value' => 'mls-wx'),
                ),
                'remark' => '初始化用户数据;返回customer;',
            ),
			array(
                'url' => 'api_hb_bjmarathon/authChezhu',
                'title' => 'bjmarathon-认证车主',
                'group_name' => 'bjmarathon',
                'params' => array(
					array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
                    array('name' => 'customer_idnumber','value' => '431126199101220100'),
					array('name' => 'source', 'value' => 'mls-wx'),
                ),
                'remark' => '',
            ),
			array(
                'url' => 'api_hb_bjmarathon/drawnLottery',
                'title' => 'bjmarathon-抽奖',
                'group_name' => 'bjmarathon',
                'params' => array(
					array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
					array('name' => 'source', 'value' => 'mls-wx'),
                ),
                'remark' => '
                返回: gift_type(奖品): 　'.json_encode($g_marathon_gift,JSON_UNESCAPED_UNICODE).'; gift_name(奖品名称);
                ',
            ),
			array(
                'url' => 'api_hb_bjmarathon/submitAddress',
                'title' => 'bjmarathon-提交地址',
                'group_name' => 'bjmarathon',
                'params' => array(
					array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
                    array('name' => 'customer_name','value' => '收货姓名'),
                    array('name' => 'customer_phone','value' => '18220000000'),
                    array('name' => 'customer_address','value' => '收地址'),
                ),
                'remark' => '',
            ),
			array(
                'url' => 'api_hb_bjmarathon/submitApply',
                'title' => 'bjmarathon-提交申请',
                'group_name' => 'bjmarathon',
                'params' => array(
					array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
					array('name' => 'source', 'value' => 'mls-wx'),
					array('name' => 'apply_name','value' => '张三'),
                    array('name' => 'apply_sex','value' => '1'),
                    array('name' => 'apply_blood','value' => 'A'),
					array('name' => 'apply_nationality','value' => '中国'),
					array('name' => 'apply_id_type','value' => '1'),
					array('name' => 'apply_id_number','value' => '0000000000000000000'),
					array('name' => 'apply_birthday','value' => '1990-01-01'),
					array('name' => 'apply_phone_1','value' => '18600000000'),
					array('name' => 'apply_phone_2','value' => '18600000001'),
					array('name' => 'apply_email_1','value' => 'kk@qq.com'),
					array('name' => 'apply_email_2','value' => 'kk2@qq.com'),
					array('name' => 'apply_city','value' => '北京'),
					array('name' => 'apply_address','value' => '卡了坚实的风口浪尖'),
					array('name' => 'apply_zipcode','value' => '100000'),
					array('name' => 'apply_emergency_contact_name','value' => '看看'),
					array('name' => 'apply_emergency_contact_phone','value' => '18500000000'),
					array('name' => 'apply_job','value' => '律师'),
					array('name' => 'apply_income','value' => '6-10万'),
					array('name' => 'apply_education','value' => '本科'),
					array('name' => 'apply_past_medical_history','value' => '无'),
					array('name' => 'apply_player_type','value' => 'A类：两年内完成过全程'),
					array('name' => 'apply_join_game_name','value' => '北京马拉松'),
					array('name' => 'apply_join_game_score','value' => '4:30:15'),
					array('name' => 'apply_join_last_year','value' => '0'),
					array('name' => 'apply_join_last_year_name','value' => '北京马拉松'),
					array('name' => 'apply_join_last_year_score','value' => '4:30:15'),
					array('name' => 'apply_mmunity_organization_1','value' => '中华少年儿童慈善救助基金会“回家的希望”'),
                    array('name' => 'apply_mmunity_organization_2','value' => '中国妇女发展基金会'),
                ),
                'remark' => '',
            ),
            array(
                'url' => 'api_360_recieve/submitInfo',
                'title' => '360安全锦囊-提交数据',
                'group_name' => '晨阳水漆',
                'params' => array(
                    array('name' => 'gift_type','value' => '1'),
                    array('name' => 'customer_name','value' => '张三'),
                    array('name' => 'customer_phone','value' => '18612345678'),
                    array('name' => 'customer_address','value' => '某地某地某地哈哈哈哈','optional' => true),
                    array('name' => 'customer_weixin','value' => ''),
                    array('name' => 'customer_passport_picture_info_path','value' => ''),
                ),
                'remark' => '<em>返回数据： img_url:图片链接</em>',
            ),

            array(
                'url' => 'api_football_game/initCustomer',
                'title' => '欧洲杯-初始化用户',
                'group_name' => '欧洲杯',
                'params' => array(
                    array('name' => 'openid','value' => 'aaa'),
                    array('name' => 'openid_md5','value' => 'e1d8f1c4ce60cefd8a1ccbafddbbb0af'),
                    array('name' => 'nickname','value' => '小明'),
                    array('name' => 'sex','value' => '1'),
                    array('name' => 'province','value' => '北京'),
                    array('name' => 'city','value' => '北京'),
                    array('name' => 'country','value' => 'CN'),
                    array('name' => 'headimgurl','value' => 'http://www.relonline.cn/resource/relonline$1/logo.jpg'),
                ),
                'remark' => '初始化用户数据;微信字段;返回customer;',
            ),
            array(
                'url' => 'api_football_game/submitScore',
                'title' => '欧洲杯-抽奖',
                'group_name' => '欧洲杯',
                'params' => array(
                    array('name' => 'game_score','value' => '280'),
                ),
                'remark' => '参数：game_score(成绩)
                ',
            ),
            array(
                'url' => 'api_football_game/getScoreList',
                'title' => '欧洲杯-返回成绩前20',
                'group_name' => '欧洲杯',
                'params' => array(
                ),
                'remark' => '
                ',
            ),

            array(
                'url' => 'Api_hb_bluemember/initCustomer',
                'title' => 'Bluemember-初始化用户',
                'group_name' => 'Bluemember',
                'params' => array(
                    array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
                    array('name' => 'bluemember_phone','value' => '18618419289'),
                ),
                'remark' => '初始化用户数据;微信字段;返回customer;',
            ),
            array(
                'url' => 'Api_hb_bluemember/drawnLottery',
                'title' => 'Bluemember-抽奖',
                'group_name' => 'Bluemember',
                'params' => array(
                    array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
                ),
                'remark' => '参数：time(耗时),count(道具数量),
                返回: gift_type(奖品): 　'.json_encode($g_bluemember_gift).'; gift_name(奖品名称);
                ',
            ),
            array(
                'url' => 'Api_hb_bluemember/submitAddress',
                'title' => 'Bluemember-提交收货地址',
                'group_name' => 'Bluemember',
                'params' => array(
                    array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
                    array('name' => 'customer_name','value' => '收货姓名'),
                    array('name' => 'customer_phone','value' => '18220000000'),
                    array('name' => 'customer_address','value' => '收地址'),
                ),
                'remark' => '
                ',
            ),
            array(
                'url' => 'Api_hb_bluemember/getGiftCustomerList',
                'title' => 'Bluemember-获取中奖信息',
                'group_name' => 'Bluemember',
                'params' => array(
                ),
                'remark' => '
                ',
            ),
            array(
                'url' => 'Api_hb_bluemember/receiveCard',
                'title' => 'Bluemember-领取卡券',
                'group_name' => 'Bluemember',
                'params' => array(
                    array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
                    array('name' => 'bluemember_phone','value' => '18618419289'),
                    array('name' => 'source','value' => 'xjfw-pc'),
                ),
                'remark' => '
                ',
            ),

            array(
                'url' => 'token.php?type=initCustomer',
                'title' => 'Bluemember-初始化用户',
                'group_name' => 'Bluemember',
                'params' => array(
                    array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
                    array('name' => 'bluemember_phone','value' => '18612345678'),
                ),
                'remark' => '初始化用户数据;微信字段;返回customer;',
            ),
            array(
                'url' => 'token.php?type=drawnLottery',
                'title' => 'Bluemember-抽奖',
                'group_name' => 'Bluemember',
                'params' => array(
                    array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
                ),
                'remark' => '参数：time(耗时),count(道具数量),
                返回: gift_type(奖品): 　'.json_encode($g_bluemember_gift).'; gift_name(奖品名称);
                ',
            ),
            array(
                'url' => 'token.php?type=submitAddress',
                'title' => 'Bluemember-提交收货地址',
                'group_name' => 'Bluemember',
                'params' => array(
                    array('name' => 'bluemember_user_id','value' => '14dc807a-4d0d-42fd-b019-5574cbb79334'),
                    array('name' => 'customer_name','value' => '收货姓名'),
                    array('name' => 'customer_phone','value' => '18220000000'),
                    array('name' => 'customer_address','value' => '收地址'),
                ),
                'remark' => '
                ',
            ),

            array(
                'url' => 'api_tech_dbf_2016_game/initCustomer',
                'title' => 'Tech粽想象之旅-初始化用户',
                'group_name' => 'Tech粽想象之旅',
                'params' => array(
                    array('name' => 'openid','value' => 'aaa'),
                    array('name' => 'openid_md5','value' => 'e1d8f1c4ce60cefd8a1ccbafddbbb0af'),
                    array('name' => 'nickname','value' => '小明'),
                    array('name' => 'sex','value' => '1'),
                    array('name' => 'province','value' => '北京'),
                    array('name' => 'city','value' => '北京'),
                    array('name' => 'country','value' => 'CN'),
                    array('name' => 'headimgurl','value' => 'http://www.relonline.cn/resource/relonline$1/logo.jpg'),
                ),
                'remark' => '初始化用户数据;微信字段;返回customer;',
            ),
            array(
                'url' => 'api_tech_dbf_2016_game/drawnLottery',
                'title' => 'Tech粽想象之旅-抽奖',
                'group_name' => 'Tech粽想象之旅',
                'params' => array(
                    array('name' => 'time','value' => '27'),
                    array('name' => 'count','value' => '16'),
                ),
                'remark' => '参数：time(耗时),count(道具数量),
                返回: gift_type(奖品): 　1 =>  zuk pro, 2 => 充电宝; gift_name(奖品名称);
                ',
            ),
            array(
                'url' => 'api_tech_dbf_2016_game/submitAddress',
                'title' => 'Tech粽想象之旅-提交收货地址',
                'group_name' => 'Tech粽想象之旅',
                'params' => array(
                    array('name' => 'customer_name','value' => '收货姓名'),
                    array('name' => 'customer_phone','value' => '18220000000'),
                    array('name' => 'customer_address','value' => '收地址'),
                ),
                'remark' => '
                ',
            ),

            array(
                'url' => 'api_lol/initCustomer',
                'title' => 'LOL游戏-初始化用户',
                'group_name' => 'LOL游戏',
                'params' => array(
                    array('name' => 'openid','value' => 'aaa'),
                    array('name' => 'openid_md5','value' => 'e1d8f1c4ce60cefd8a1ccbafddbbb0af'),
                    array('name' => 'nickname','value' => '小明'),
                    array('name' => 'sex','value' => '1'),
                    array('name' => 'province','value' => '北京'),
                    array('name' => 'city','value' => '北京'),
                    array('name' => 'country','value' => 'CN'),
                    array('name' => 'headimgurl','value' => 'http://www.relonline.cn/resource/relonline$1/logo.jpg'),
                ),
                'remark' => '初始化用户数据;微信字段;返回customer;',
            ),
            array(
                'url' => 'api_lol/apply',
                'title' => 'LOL游戏-报名',
                'group_name' => 'LOL游戏',
                'params' => array(
                    array('name' => 'customer_apply_score','value' => '80'),
                    array('name' => 'customer_apply_info','value' => '答案'),
                    array('name' => 'customer_name','value' => '小明'),
                    array('name' => 'customer_phone','value' => '18612345678'),
                ),
                'remark' => 'customer_apply_score:分数， customer_apply_info:答案; 返回customer;',
            ),

            array(
                'url' => 'api_hb_oil_subsidy/initCustomer',
                'title' => '戳戳乐-初始化用户',
                'group_name' => '戳戳乐',
                'params' => array(
                    array('name' => 'openid','value' => 'aaa'),
                    array('name' => 'openid_md5','value' => 'e1d8f1c4ce60cefd8a1ccbafddbbb0af'),
                    array('name' => 'nickname','value' => '小明'),
                    array('name' => 'sex','value' => '1'),
                    array('name' => 'province','value' => '北京'),
                    array('name' => 'city','value' => '北京'),
                    array('name' => 'country','value' => 'CN'),
                    array('name' => 'headimgurl','value' => 'http://www.relonline.cn/resource/relonline$1/logo.jpg'),
                ),
                'remark' => '初始化用户数据;微信字段;返回customer;city_data:城市数据',
            ),
            array(
                'url' => 'api_hb_oil_subsidy/startGame',
                'title' => '戳戳乐-开始游戏',
                'group_name' => '戳戳乐',
                'params' => array(
                    array('name' => 'city_id','value' => '1'),
                ),
                'remark' => '<em>code:结束游戏，提交</em>',
            ),
            array(
                'url' => 'api_hb_oil_subsidy/endGame',
                'title' => '戳戳乐-结束游戏',
                'group_name' => '戳戳乐',
                'params' => array(
                    array('name' => 'city_id','value' => '1'),
                    array('name' => 'click_times','value' => '100'),
                    array('name' => 'code','value' => ''),
                ),
                'remark' => 'gift_money:红包金额',
            ),


            array(
                'url' => 'api_hb_game/initCustomer',
                'title' => '北京现代-初始化用户',
                'group_name' => '北京现代',
                'params' => array(
                    array('name' => 'openid','value' => 'aaa'),
                    array('name' => 'openid_md5','value' => 'e1d8f1c4ce60cefd8a1ccbafddbbb0af'),
                    array('name' => 'nickname','value' => '小明'),
                    array('name' => 'sex','value' => '1'),
                    array('name' => 'province','value' => '北京'),
                    array('name' => 'city','value' => '北京'),
                    array('name' => 'country','value' => 'CN'),
                    array('name' => 'headimgurl','value' => 'http://www.relonline.cn/resource/relonline$1/logo.jpg'),
                ),
                'remark' => '初始化用户数据;微信字段;返回customer;',
            ),
            array(
                'url' => 'api_hb_game/submitRunResult',
                'title' => '北京现代-提交跑的距离',
                'group_name' => '北京现代',
                'params' => array(
                    array('name' => 'distance','value' => '325'),
                ),
                'remark' => '<em>返回数据： salt: 安全码，需要抽奖的接口传回; closer_percent: 比例</em>',
            ),

            array(
                'url' => 'api_hb_game/drawnLottery',
                'title' => '北京现代-抽奖',
                'group_name' => '北京现代',
                'params' => array(
                    array('name' => 'salt','value' => ''),
                ),
                'remark' => '
                返回: gift_type(奖品): 　1 =>  精美领动汽车模型, 2 => 胡歌帅气写真集, 3 => 胡歌领动cp画册, 4 => 专为“看片族”定制的VR眼镜; gift_name(奖品名称);
                ',
            ),
            array(
                'url' => 'api_hb_game/submitAddress',
                'title' => '北京现代-提交收货地址',
                'group_name' => '北京现代',
                'params' => array(
                    array('name' => 'customer_name','value' => '收货姓名'),
                    array('name' => 'customer_phone','value' => '18220000000'),
                    array('name' => 'customer_address','value' => '收地址'),
                ),
                'remark' => '
                ',
            ),
            array(
                'url' => 'api_hb_game/getLotteryCustomerList',
                'title' => '北京现代-得到中奖用户',
                'group_name' => '北京现代',
                'params' => array(
                ),
                'remark' => '
                ',
            ),
		);

		$this->response->setSuccess();
		$this->response->setItems($apis);
		$this->response->responseExit();
	}
}
/* End of file console.php */
/* Location: ./application/controllers/console.php */
